package cn.gson.crm.control.position;

import java.util.List;
import java.util.Map;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


import cn.gson.crm.control.base.BaseServlet;
import cn.gson.crm.model.dao.PositionDao;
import cn.gson.crm.model.entity.Position;

/**
 * Servlet implementation class JobServlet
 */
@WebServlet("/job")
public class JobServlet extends BaseServlet {
	private static final long serialVersionUID = 1L;
	private PositionDao pd=new PositionDao();
       
	@Override
	protected void get(HttpServletRequest request, HttpServletResponse response) throws Exception {	
		String p = request.getParameter("page");
		String jobName = request.getParameter("jobName");
		if (p == null || p.isEmpty()) {
			p = "1";
		}
		//List<Position>delList=pd.getDelJob(1);
		Integer page = Integer.parseInt(p);
		// 当前页数据
		List<Position> positionList = pd.getPagepositionListByType(1, page, jobName);
		// 总页数
		int totalPage = pd.getTotalPage(1,jobName);
		request.setAttribute("queryString", noPageQueryString());
		request.setAttribute("positionList", positionList);
		request.setAttribute("totalPage", totalPage);
		request.setAttribute("page", page);
		//request.setAttribute("delList", delList);
		forward("position/jobinfor.jsp");}
}
